{extend name="public/header" /}
{block name="body"}
<body>
{include file="public/common" /}
<div class="layui-form">
    <table class="layui-table" lay-size="sm">
        <thead>
        <tr>
            <th width="80">ID</th>
            <th>名称</th>
            <th>状态</th>
            <th>排序</th>
            <th width="240">操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach name="list" item="vo"}
        <tr>
            <td>{$vo.id}</td>
            <td>{$vo.cname}</td>
            <td>
			<input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$vo.status}" lay-text="正常|禁用" {eq name="vo.status" value="1"}checked{/eq} data-url='{:url("ajax/upField",array("table"=>"admin_menu","id_name"=>"id","id_value"=>$vo["id"],"field"=>"status"))}'>
			</td>
            <td><input type="text" class="layui-input ajax-sort" name="field_value" value="{$vo.sort}" data-url='{:url("ajax/upField",array("table"=>"admin_menu","id_name"=>"id","id_value"=>$vo["id"],"field"=>"sort"))}' data-value="{$vo.sort}"></td>
            <td>
                {notin name="vo.id" value='1'}
                <a class="layui-btn layui-btn-sm modal-catch" href="{:url('menu/info',array('id'=>$vo['id']))}">
                    <i class="layui-icon">&#xe642;</i>编辑
                </a>
                <a class="layui-btn layui-btn-sm layui-btn-danger ajax-del" data-url='{:url("menu/del")}' data-field='id' data-value='{$vo.id}'>
                    <i class="layui-icon">&#xe640;</i>删除
                </a>
                {else /}
                无法操作
                {/notin}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
</div>
</body>
{/block}
{block name="script"}
<script>
layui.use(['jquery','element','layer','form','layajax'], function(){
	var $ = layui.jquery
	,layer = layui.layer
	,element = layui.element
	,form = layui.form
	,layajax = layui.layajax;
	
	form.render();
});
</script>
{/block}